<script setup>
import { ref, reactive } from "vue";
import downloadExcel from "./components/json-excel.vue";
let jsonData = ref([]);

const json_fields = reactive({
  url: "url",
  uv: "uv",
  pv: "pv",
  LCP平均值: "averge",
  LCP90分位: "nineTy",
});

const test = () => {
  jsonData.value = [
    {
      uv: 1,
      pv: 1,
      averge: 1,
      nineTy: 1,
      url: 1,
    },
  ];
};
</script>

<template>
  <download-excel :json-data="jsonData" :fields="json_fields">
    <button>click</button>
  </download-excel>
  <button @click="test">setData</button>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
